﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.PA
{
    class Class6
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("重大疾病"))
            {
                ppa.Fee = 0;
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Age <60)
            {
                if (ppa.PolicyActing.PeriodActings.Where(q => q.Period <= ppa.Period && q.Period>0).FirstOrDefault(p => p.SchemePeriodActing.InsurantStates.Contains("意外伤害"))!=null)
                {
                    da.Value = ppa.Amount * 0.12;
                }
            }

        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Age >=60)
            {
                da.Value = ppa.Amount * 0.12;
                
            }
              

        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Age == 100)
            {
                da.Value = ppa.Amount * 0.08;
                ppa.IsCurrentFinish = true;
            }


        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if(ppa.SchemePeriodActing.InsurantStates.Contains("疾病身故"))
            {
                ppa.SchemePeriodActing.InsurantStates.Add("身故");
                da.Value = ppa.Amount * 5 - ppa.GetDutyTotalValue("老年护理保险金");
                ppa.IsCurrentFinish = true;
            }
        }
    }
}
